import { defineStore } from 'pinia'
import { ref } from "vue"

export const useUserStore = defineStore(
    'user',
    () => {

        const userInfo = ref({})
        const setDefaultWallet = (info) => {
            userInfo.value = info
        }

        return {
            userInfo,
            setDefaultWallet,
        }
    },
    // TODO: 持久化
    {
        persist: {
            storage: localStorage,
            paths: ['userInfo'],
        },
    },
)